<!-- toaster directive -->
<toaster-container
	toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<style scoped>

.col-lg-1 {
	width: 140px;
}

</style>

<!-- 导航条 -->
<div class="bg-white bread-crumb">
	<ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
		<li><a ui-sref="main"><i class="glyphicon glyphicon-modal-window"></i> 设备管理</a></li>
		<li><a ui-sref="main.dm.ability.list" class="active">设备能力</a></li>
		<li class="active" ng-bind="title"></li>
	</ul>
</div>

<!-- 内容区域 -->
<div class="wrapper-md content">
	<div class="panel panel-default">
		<!-- 头部 -->
		<div class="panel-heading font-bold">
			<a class="btn btn-sm btn-icon btn-rounded btn-default pull-right m-t-n-xs"
			   ui-sref="main.dm.ability.list">
			   <i class="text-md glyphicon glyphicon-chevron-up text-muted"></i>
			</a>
		</div>
		<!--表单-->
		<div class="panel-body">
			<form class="form-horizontal" name="house_form">
				<div class="line line-dashed b-b line-lg pull-in"></div>

				<input type="text" class="form-control" ng-model="record.categoryId" ng-hide="true">
				<div class="form-group">
					<label class="col-lg-1 control-label text-right" for="abilityName"><span class="text-danger wrapper-sm">*</span>能力名称：</label>
					<div class="col-lg-4">
						<input type="text" class="form-control" ng-model="record.abilityName" name="abilityName" id="abilityName">
					</div>
				</div>
				
				<div class="form-group">
					<label class="col-lg-1 control-label text-right"><span class="text-danger wrapper-sm">*</span>取值类型：</label>
					<div class="col-lg-4">
						<select class="form-control" ng-model="record.valueType" name="valueType">
							<option value="" ng-selected="1"></option>
							<option value="enum1" ng-selected="enum1">enum1</option>
							<option value="enum2">enum2</option>
						</select>
					</div>
				</div>
				
				<div class="line line-dashed b-b line-lg pull-in"></div>
				
				<div class="form-group">
				    <label class="col-lg-1 control-label text-right" for="categoryName"><span class="text-danger wrapper-sm">*</span>类型名称：</label>
					<div class="col-lg-4">
					    <input type="text" class="form-control" ng-model="record.categoryName"id="categoryName" name="categoryName" ng-click="openCategory()">
					</div>
				</div>

				<div class="form-group">
					<label class="col-lg-1 control-label text-right" for="abilityCode">能力代码：</label>
					<div class="col-lg-4">
						<input type="text" class="form-control" ng-model="record.abilityCode" name="abilityCode" id="abilityCode">
					</div>
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>

				<div class="form-group">
					<label class="col-lg-1 control-label text-right">默认值：</label>
					<div class="col-lg-4">
						<input type="text" class="form-control" ng-model="record.defValue" name="defValue">
					</div>
				</div>


				<div class="form-group">
					<label class="col-lg-1 control-label text-right">最大值：</label>
					<div class="col-lg-4">
						<input type="text" class="form-control" ng-model="record.max">
					</div>
				</div>

				<div class="line line-dashed b-b line-lg pull-in"></div>

				<div class="form-group">
					<label class="col-lg-1 control-label text-right">最小值：</label>
					<div class="col-lg-4">
						<input type="text" class="form-control" ng-model="record.min">
					</div>
				</div>


				<div class="form-group">
					<label class="col-lg-1 control-label text-right">读写权限：</label>
					<div class="col-lg-4">
						<select class="form-control" ng-model="record.rwRight" name="rwRight">
						    <option value="" ng-selected="1"></option>
							<option value="read">读</option>
							<option value="write">写</option>
						</select>
					</div>
				</div>

				<div class="line line-dashed b-b line-lg pull-in"></div>

				<div class="form-group" style="width: 100%">
					<div class="col-sm-6 col-sm-offset-2 text-center"
						 style="width: 100%;margin: 0;padding: 0;text-align: center">
						<button type="button" class="btn  w-xs addNew" ng-show="reset" ng-click="resetFrom()">重置</button>
						<button type="submit" class="btn btn-info w-xs m-l-xl addNew" ng-disabled="isDisabled">保存</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>

<!-- 设备类型模态框 -->
<script type="text/ng-template" id="categoryList.html" >  
<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
            <!-- 头部 -->
            <div class="panel-heading clearfix">
                
                <div class="w-auto">
                    <form ng-submit="search()" class="form-inline">
                 
						<div class="form-group">
								<label for="identity">类型编码：</label> <input type="text"
									class="form-control" style="width: 180px" id="identity"
									placeholder="" ng-model="param.categoryId">
							</div>
							<div class="form-group">
								<label for="categoryName">类型名称：</label>
								<input type="text"class="form-control" style="width: 180px" id="categoryName" name="categoryName" ng-model="param.categoryName">
							</div>

							<button type="submit" class="btn btn-primary new-primary"style="margin-left: 10px">查询</button>

                    </form>
                </div>
            </div>

            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center">
                    <thead>
                    <tr>
						<th>类型名称</th>
						<th>设备分类</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                   <tr ng-repeat="item in pageInfo.data">
                        <!--<td class="v-middle">{{item.categoryId}}</td>-->
						<td class="v-middle">{{item.categoryName}}</td>
					    <td class="v-middle">{{item.deviceCategory}}</td>
                        <td class="v-middle"><a ng-click="selectCategory(item.categoryId,item.categoryName)">选择</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div><!-- /.table-responsive -->

            <!-- 底部分页 -->
			<span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
        </div><!-- /.panel -->
    </div><!-- /.wrapper-data -->

			</div><!-- /.wrapper-md -->  
        <div class="modal-footer">  
            <button class="btn btn-warning addNew" ng-click="cancel()">取消</button>
        </div>  
</script>

<style scoped>
	.form-group{
		width:40%;
		float: left;
	}
	.form-group .col-lg-2{
		width:25%;
	}
	.form-group .col-lg-4{
		width:65%;
	}
	.app-content-body .content{
		margin-top:44px;
	}
</style>